#ifndef GNCRITICALSECTION_H
#define GNCRITICALSECTION_H
#include "GnDebug.h"

#define GNMULTITHREADED

class GNSYSTEM_ENTRY GnCriticalSection
{
public:
	GNFORCEINLINE GnCriticalSection();
	GNFORCEINLINE ~GnCriticalSection();
	
	GNFORCEINLINE void Lock();
	GNFORCEINLINE void Unlock();

protected:
#if defined(GNMULTITHREADED)

#if defined(WIN32) || defined(_XENON)
	CRITICAL_SECTION m_kCriticalSection;
#elif defined (_PS3)
	sys_mutex_t m_kCriticalSection;
#endif // #if defined(WIN32) || defined(_XENON)

#if defined (_DEBUG)
	bool m_bLocked;
#endif // #if defined (_DEBUG)

#endif // #if defined (NI_MULTITHREADED)
};

#include "GnCriticalSection.inl"
#endif // GNCRITICALSECTION_H
